"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.http = void 0;
const client_1 = require("./client");
const getAxiosConfig_1 = require("./getAxiosConfig");
const addQueryParams_1 = require("./addQueryParams");
async function getRequest(options) {
    const { params, ...rest } = options;
    const optionsWithParams = (0, addQueryParams_1.addQueryParams)(rest, params);
    const requestConfig = await (0, getAxiosConfig_1.getAxiosConfig)(optionsWithParams);
    return (0, client_1.httpClient)(requestConfig);
}
async function postRequest(options) {
    const requestConfig = await (0, getAxiosConfig_1.getAxiosConfig)(options);
    return (0, client_1.httpClient)({ ...requestConfig, method: 'post' });
}
async function putRequest(options) {
    const requestConfig = await (0, getAxiosConfig_1.getAxiosConfig)(options);
    return (0, client_1.httpClient)({ ...requestConfig, method: 'put' });
}
async function patchRequest(options) {
    const requestConfig = await (0, getAxiosConfig_1.getAxiosConfig)(options);
    return (0, client_1.httpClient)({ ...requestConfig, method: 'patch' });
}
async function deleteRequest(options) {
    const requestConfig = await (0, getAxiosConfig_1.getAxiosConfig)(options);
    return (0, client_1.httpClient)({ ...requestConfig, method: 'delete' });
}
exports.http = {
    get: getRequest,
    post: postRequest,
    put: putRequest,
    patch: patchRequest,
    delete: deleteRequest,
};
